package org.o14x.alpha.ui;

import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.o14x.alpha.ui.controller.UIController;
import org.o14x.alpha.ui.perspectives.MainPerspective;

/**
 * Application's ApplicationWorkbenchAdvisor.
 * 
 * @author Olivier DANGREAUX
 */
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
	/**
	 * Main perspective's id.
	 */
	private static final String PERSPECTIVE_ID = MainPerspective.ID;

	/**
	 * UIController.
	 */
	private UIController uiController;

	/**
	 * {@inheritDoc}
	 */
	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
		return new ApplicationWorkbenchWindowAdvisor(configurer, uiController);
	}

	/**
	 * {@inheritDoc}
	 */
	public String getInitialWindowPerspectiveId() {
		return PERSPECTIVE_ID;
	}

	/**
	 * Returns the value of uiController.
	 *
	 * @return The value of uiController.
	 */
	public UIController getUiController() {
		return uiController;
	}

	/**
	 * Sets the value of uiController.
	 *
	 * @param uiController The value of uiController to set.
	 */
	public void setUiController(UIController uiController) {
		this.uiController = uiController;
	}
}
